package com.rgs.se.oom;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Ren Gaoshuai
 * @ClassName HeapOOM
 * VM: -Xms20M -Xmx20M 最大最小空间设置一致，表示进制自动扩大
 * 模拟堆内存OOM OutOfMemoryError
 * @date 2022-03-06 11:20
 **/
public class HeapOOM {
    static class OOMObject{

    }

    public static void main(String[] args) {
        List<OOMObject> list = new ArrayList<>();
        while(true){
            list.add(new OOMObject());
        }
    }
}
